home *** CD-ROM | disk | FTP | other *** search
- var linkextendXpiInstaller = {
- extFullName: "FoxLingo",
- extShortName: "foxlingo",
- extVersion: "2.5.2",
- extAuthor: "Linkular LLC",
- extLocaleNames: ['af-ZA', 'ar-SA', 'ca-AD', 'cs-CZ', 'da-DK', 'de-DE', 'es-ES', 'fr-FR', 'gl-ES', 'he-IL', 'id-ID', 'it-IT', 'ja-JP', 'nl-NL', 'pl-PL', 'pt-BR', 'ro-RO',
- 'ru-RU', 'zh-TW', 'en-US'],
- extPostInstallMessage: null,
-
- profileInstall: true,
- silentInstall: false,
-
- install: function() {
- if (Install.arguments && (Install.arguments == "p=0" || Install.arguments == "p=1")) {
- this.profileInstall = (Install.arguments == "p=1");
- this.silentInstall = true;
- }
-
- var jarName = this.extShortName + ".jar";
- var profileDir = Install.getFolder("Profile", "chrome");
-
- if (File.exists(Install.getFolder(profileDir, jarName))) {
- if (!this.silentInstall)
- Install.alert("Updating existing Profile install of " + this.extFullName + " to version " + this.extVersion + ".");
- this.profileInstall = true;
- } else if (!this.silentInstall) {
- this.profileInstall = Install.confirm("Install " + this.extFullName + " " + this.extVersion + " to your Profile directory (OK) or your Browser directory (Cancel)?");
- }
-
- Install.initInstall(this.extFullName, this.extShortName, this.extVersion);
-
- var installPath = (this.profileInstall)?profileDir:Install.getFolder("chrome");
-
- Install.addFile(null, "chrome/" + jarName, installPath, null);
-
- var jarPath = Install.getFolder(installPath, jarName);
- var installType = (this.profileInstall)?Install.PROFILE_CHROME:Install.DELAYED_CHROME;
-
- Install.registerChrome(Install.CONTENT | installType, jarPath, "content/");
-
- for (var locale in this.extLocaleNames) {
- var regPath = "locale/" + this.extLocaleNames[locale] + "/" + this.extShortName + "/";
- Install.registerChrome(Install.LOCALE | installType, jarPath, regPath);
- }
- Install.registerChrome(Install.SKIN | installType, jarPath, "skin/");
-
- if (!this.profileInstall) {
- installPath = Install.getFolder("Components");
- for (var comp in this.extComponents) {
- Install.addFile(null, "components/" + this.extComponents[comp], installPath, null);
- }
- }
-
- var err = Install.performInstall();
- if (err == Install.SUCCESS || err == Install.REBOOT_NEEDED) {
- if (!this.silentInstall && this.extPostInstallMessage)
- Install.alert(this.extPostInstallMessage);
- } else {
- if (!this.silentInstall)
- Install.alert("Error: Could not install " + this.extFullName + " " + this.extVersion + " (Error code: " + err + ")");
- Install.cancelInstall(err);
- }
- }
- };
-
- linkextendXpiInstaller.install();
-